<?php get_header(); ?>

	<div id="content_single" class="narrowcolumn">

	<script type="text/javascript" src="/js/stepcarousel.js"></script>
	<script type="text/javascript">
		
		stepcarousel.setup({
			galleryid: 'stepcarouse_tl',
			beltclass: 'stepcarouse_belt_tl',
			panelclass: 'stepcarouse_tl_thumb',
			<?php $featured_speed = obwp_get_meta(SHORTNAME."_featured_speed",'int',5); ?>
			autostep: {enable:true, moveby:1, pause:<?php echo $featured_speed*1000; ?>},
			panelbehavior: {speed:500, wraparound:false, persist:false},
			defaultbuttons: {enable: false, moveby: 1},
			statusvars: ['statusA', 'statusB', 'statusC'],
			contenttype: ['inline']
		})
		
	</script>
	<div id="carousel_t1">
		<div id="carousel_t1_box">
			<div id="stepcarouse_tl">
				<div class="stepcarouse_belt_tl">
				<?php $featured_post_count = obwp_get_meta(SHORTNAME."_featured_post_count",'int',5); ?>
				<?php $carousel_posts = carousel_featured_posts($featured_post_count); $coint_i=0; foreach($carousel_posts as $carousel_post) { ?>
				<?php
					$coint_i++;
					
					$bg = obwp_getcustomfield('feature_image', $carousel_post->ID);
					if( empty($bg) )
						$bg = 'http://xirang.us/images/no_image.png';
					$carousel_title = $carousel_post->post_title;
					$post_content = $carousel_post->post_content;
					if(!empty($carousel_post->post_excerpt))
						$post_content = $carousel_post->post_excerpt;
				?>
				<div class="stepcarouse_tl_thumb" style="background:url(<?php echo $bg; ?>) no-repeat;">
					<div class="stepcarouse_tl_entry">
						<h2><a href="<?php echo get_permalink($carousel_post->ID); ?>" rel="bookmark"><?php echo $carousel_title; ?></a></h2>
						<p><?php echo cut_utf8($post_content, 350); ?><a href="<?php echo get_permalink($carousel_post->ID); ?>" rel="bookmark">阅读全文>></a></p>
					</div>
				</div>
				<?php } ?>
				</div>
			</div>
		</div>
		<div id="board_carusel_nav">
			<ul>
			<?php for($i=1;$i<=$coint_i; $i++) { ?>
				<li id="board_carusel_nav_<?php echo $i; ?>"><a <?php if($i==1) echo ' class="selected"'; ?> href="javascript:stepcarousel.stepTo('stepcarouse_tl', <?php echo $i; ?>)"><?php echo $i; ?></a></li>
			<?php } ?>
			</ul>
		</div>
	</div>

	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
				<div class="post_comm">
					<p class="post_date"><?php the_time('Y年m月d日') ?></p>
					<p class="post_author">作者：<span><a href="/author/<?php the_author_login(); ?>" target="_self"><?php the_author(); ?></a></span></p>
					<?php if(function_exists('the_views')) : ?>
						<p class="post_comments">热度：<span><?php the_views(); ?>°C</span></p>
					<?php endif; ?>
					<p class="post_comments">噪音：<span><?php comments_popup_link('想要打破沉默吗？', '可怜的一分贝', '%分贝'); ?></span></p>
					<p class="post_comments"><?php edit_post_link('编辑本文', '', ''); ?></p>
				</div>
                <div class="post_top">
                    <div class="post_title">
                        <h2><?php the_title(); ?></h2>
						<p class="post_cats">分类：<span><?php the_category(' | ') ?>&nbsp;&nbsp;<?php the_tags('标签：', ' | ', ''); ?></span></p>
                    </div>
                </div>
				<div class="entry">
					<?php obwp_google_300_ads_show(); ?>
					<?php the_content('挺有意思，往下瞧瞧 &raquo;'); ?>
					<?php obwp_google_468_ads_show(); ?>
				</div>
			</div>
	<?php comments_template(); ?>

	<?php endwhile; else: ?>

		<h2 class="center">啊哦，这里似乎没有任何可以显示的内容</h2>
		<h2 class="center">建议您访问<a href="http://xirang.us" title="嘻来嚷往">我们的首页</a>、阅读本站精选文章或者试着搜索感兴趣的内容</h2>
		<div id="no_result">
			<form method="get" id="no_result_top" action="/">
				<div>
					<input type="text" value="请输入您想搜索的关键字" name="s" id="no_result_top_text" onfocus="if (this.value == '请输入您想搜索的关键字') {this.value = '';}" onblur="if (this.value == '') {this.value = '请输入您想搜索的关键字';}" /><input type="submit" id="searchsubmit" value="搜索" />
				</div>
			</form>
		</div>
		<script type="text/javascript" src="/js/stepcarousel.js"></script>
		<script type="text/javascript">
		
		stepcarousel.setup({
			galleryid: 'stepcarouse_tl',
			beltclass: 'stepcarouse_belt_tl',
			panelclass: 'stepcarouse_tl_thumb',
			<?php $featured_speed = obwp_get_meta(SHORTNAME."_featured_speed",'int',5); ?>
			autostep: {enable:true, moveby:1, pause:<?php echo $featured_speed*1000; ?>},
			panelbehavior: {speed:500, wraparound:false, persist:false},
			defaultbuttons: {enable: false, moveby: 1},
			statusvars: ['statusA', 'statusB', 'statusC'],
			contenttype: ['inline']
		})
		
	</script>
	<div id="carousel_t1">
		<div id="carousel_t1_box">
			<div id="stepcarouse_tl">
				<div class="stepcarouse_belt_tl">
				<?php $featured_post_count = obwp_get_meta(SHORTNAME."_featured_post_count",'int',5); ?>
				<?php $carousel_posts = carousel_featured_posts($featured_post_count); $coint_i=0; foreach($carousel_posts as $carousel_post) { ?>
				<?php
					$coint_i++;
					
					$bg = obwp_getcustomfield('feature_image', $carousel_post->ID);
					if( empty($bg) )
						$bg = 'http://xirang.us/images/no_image.png';
					$carousel_title = $carousel_post->post_title;
					$post_content = $carousel_post->post_content;
					if(!empty($carousel_post->post_excerpt))
						$post_content = $carousel_post->post_excerpt;
				?>
				<div class="stepcarouse_tl_thumb" style="background:url(<?php echo $bg; ?>) no-repeat;">
					<div class="stepcarouse_tl_entry">
						<h2><a href="<?php echo get_permalink($carousel_post->ID); ?>" rel="bookmark"><?php echo $carousel_title; ?></a></h2>
						<p><?php echo cut_utf8($post_content, 350); ?><a href="<?php echo get_permalink($carousel_post->ID); ?>" rel="bookmark">阅读全文>></a></p>
					</div>
				</div>
				<?php } ?>
				</div>
			</div>
		</div>
		<div id="board_carusel_nav">
			<ul>
			<?php for($i=1;$i<=$coint_i; $i++) { ?>
				<li id="board_carusel_nav_<?php echo $i; ?>"><a <?php if($i==1) echo ' class="selected"'; ?> href="javascript:stepcarousel.stepTo('stepcarouse_tl', <?php echo $i; ?>)"><?php echo $i; ?></a></li>
			<?php } ?>
			</ul>
		</div>
	</div>
	
	<div class="entry">
		<?php obwp_google_468_ads_show(); ?>
	</div>

<?php endif; ?>

	</div>
	
	<?php get_sidebar(); ?>

<?php get_footer(); ?>
